package exception;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/3/9
 **/
public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始");
        FileOutputStream fos=null;
        try {
            fos=new FileOutputStream(".a/b/fos.dat");
            fos.write(1);
        }catch (IOException e){
            System.out.println("出现异常并解决了");
        }
        try {
            fos.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("程序结束");
    }
}
